﻿


/*========================================================================================
//Goodasong -- MySnake
//创建者: 郑雪松
//创建时间：2013年3月28日
//类描述：实体类 MdLongLa (属性说明自动提取数据库字段的描述信息)
//最后修改者:郑雪松
//最后修改时间:2013年3月28日	
=========================================================================================*/
using System;
using System.Web;
using System.Runtime.Serialization;

namespace COM.PreAlarm.Model
{
    /// <summary>
    /// 实体类 MdLongLa (属性说明自动提取数据库字段的描述信息)
    /// </summary>
    [Serializable]
    [Model(Name = "MdLongLa", PrimaryKey = "LongLa_ID", ModelType = ModelType.Table, Condition = "1=1", IsNeedRecordModify = true)]
    public partial class MdLongLaInfo : BaseModel
    {
        public MdLongLaInfo()
        {
            PrimaryKey = "LongLa_ID";
            Fields.Add("LongLa_ID");//LongLa_ID
            Fields.Add("City");//市
            Fields.Add("County");//县（区
            Fields.Add("NAME");//村（街道、单位）
            Fields.Add("Longitude");//经度
            Fields.Add("Latitude");//纬度
            Fields.Add("KeyWords");//关键字


            CanNotNullFields.Add("LongLa_ID");//LongLa_ID不能为空!				

            CanNotNullFields.Add("City");//市不能为空!				

            CanNotNullFields.Add("County");//县（区不能为空!				

            CanNotNullFields.Add("NAME");//村（街道、单位）不能为空!				
            this.OnCreated();
            this.OnModelCreated();
        }
        public MdLongLaInfo(bool isNewInfo)
            : this()
        {
            IsNew = isNewInfo;
        }
        #region 方法

        public void OnCreated() { this.SetPrimaryKeyValue(); }

        public override void SetPrimaryKeyValue()
        {

            LongLa_ID = Guid.NewGuid();
        }
        #endregion

        #region 成员变量

        private Guid _LongLa_ID;//LongLa_ID
        private string _City;//市
        private string _County;//县（区
        private string _NAME;//村（街道、单位）
        private decimal _Longitude;//经度
        private decimal _Latitude;//纬度
        private string _KeyWords;//关键字

        #endregion

        #region 属性

        /// <summary>
        /// LongLa_ID
        /// </summary>       
        [ModelField(Description = "LongLa_ID", Type = typeof(Guid), ErrorMessage = "LongLa_ID信息错误!", FieldType = FieldType.Normal, IsKeyField = true, IsUnique = true, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 16, DbType = "uniqueidentifier", IsNeedRecordModify = true)]
        public virtual Guid LongLa_ID
        {
            get
            {
                return this._LongLa_ID;
            }
            set
            {
                if (_LongLa_ID != value || (_LongLa_ID == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "LongLa_ID", _LongLa_ID, value, "uniqueidentifier", "LongLa_ID");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLongLa_IDChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._LongLa_ID = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLongLa_IDChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _LongLa_ID = value;
                    }
                }
            }
        }

        /// <summary>
        /// 市
        /// </summary>       
        [ModelField(Description = "市", Type = typeof(string), ErrorMessage = "市信息错误!", FieldType = FieldType.Normal, IsKeyField = false, IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 50, DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string City
        {
            get
            {
                return this._City;
            }
            set
            {
                if (_City != value || (_City == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "City", _City, value, "nvarchar", "市");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnCityChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._City = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnCityChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _City = value;
                    }
                }
            }
        }

        /// <summary>
        /// 县（区
        /// </summary>       
        [ModelField(Description = "县（区", Type = typeof(string), ErrorMessage = "县（区信息错误!", FieldType = FieldType.Normal, IsKeyField = false, IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 50, DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string County
        {
            get
            {
                return this._County;
            }
            set
            {
                if (_County != value || (_County == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "County", _County, value, "nvarchar", "县（区");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnCountyChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._County = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnCountyChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _County = value;
                    }
                }
            }
        }

        /// <summary>
        /// 村（街道、单位）
        /// </summary>       
        [ModelField(Description = "村（街道、单位）", Type = typeof(string), ErrorMessage = "村（街道、单位）信息错误!", FieldType = FieldType.Normal, IsKeyField = false, IsUnique = false, IsForeignKey = false, IsAllowNull = false, IsDbGenerated = false, Size = 50, DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string NAME
        {
            get
            {
                return this._NAME;
            }
            set
            {
                if (_NAME != value || (_NAME == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "NAME", _NAME, value, "nvarchar", "村（街道、单位）");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnNAMEChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._NAME = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnNAMEChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _NAME = value;
                    }
                }
            }
        }

        /// <summary>
        /// 经度
        /// </summary>       
        [ModelField(Description = "经度", Type = typeof(decimal), ErrorMessage = "经度信息错误!", FieldType = FieldType.Normal, IsKeyField = false, IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 9, DbType = "decimal", IsNeedRecordModify = true)]
        public virtual decimal Longitude
        {
            get
            {
                return this._Longitude;
            }
            set
            {
                if (_Longitude != value || (_Longitude == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "Longitude", _Longitude, value, "decimal", "经度");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLongitudeChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Longitude = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLongitudeChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _Longitude = value;
                    }
                }
            }
        }

        /// <summary>
        /// 纬度
        /// </summary>       
        [ModelField(Description = "纬度", Type = typeof(decimal), ErrorMessage = "纬度信息错误!", FieldType = FieldType.Normal, IsKeyField = false, IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 9, DbType = "decimal", IsNeedRecordModify = true)]
        public virtual decimal Latitude
        {
            get
            {
                return this._Latitude;
            }
            set
            {
                if (_Latitude != value || (_Latitude == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "Latitude", _Latitude, value, "decimal", "纬度");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnLatitudeChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._Latitude = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnLatitudeChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _Latitude = value;
                    }
                }
            }
        }

        /// <summary>
        /// 关键字
        /// </summary>       
        [ModelField(Description = "关键字", Type = typeof(string), ErrorMessage = "关键字信息错误!", FieldType = FieldType.Normal, IsKeyField = false, IsUnique = false, IsForeignKey = false, IsAllowNull = true, IsDbGenerated = false, Size = 6, DbType = "nvarchar", IsNeedRecordModify = true)]
        public virtual string KeyWords
        {
            get
            {
                return this._KeyWords;
            }
            set
            {
                if (_KeyWords != value || (_KeyWords == null && value == null))
                {
                    if (!IsGetDataFromDB)
                    {
                        ModifyInfo modifyInfo = new ModifyInfo("MdLongLa", "KeyWords", _KeyWords, value, "nvarchar", "关键字");
                        this.OnPropertyChanging(modifyInfo);
                        this.OnKeyWordsChanging(modifyInfo);
                        this.SendPropertyChanging(modifyInfo);

                        this._KeyWords = value;

                        this.OnPropertyChanged(modifyInfo);
                        this.OnKeyWordsChanged(modifyInfo);
                        this.SendPropertyChanged(modifyInfo);
                    }
                    else
                    {
                        _KeyWords = value;
                    }
                }
            }
        }
        #endregion 属性

        #region 属性更改事件

        partial void OnLongLa_IDChanging(ModifyInfo modifyInfo);//LongLa_IDLongLa_ID改变之前发生
        partial void OnLongLa_IDChanged(ModifyInfo modifyInfo);//LongLa_IDLongLa_ID改变之后发生
        partial void OnCityChanging(ModifyInfo modifyInfo);//市City改变之前发生
        partial void OnCityChanged(ModifyInfo modifyInfo);//市City改变之后发生
        partial void OnCountyChanging(ModifyInfo modifyInfo);//县（区County改变之前发生
        partial void OnCountyChanged(ModifyInfo modifyInfo);//县（区County改变之后发生
        partial void OnNAMEChanging(ModifyInfo modifyInfo);//村（街道、单位）NAME改变之前发生
        partial void OnNAMEChanged(ModifyInfo modifyInfo);//村（街道、单位）NAME改变之后发生
        partial void OnLongitudeChanging(ModifyInfo modifyInfo);//经度Longitude改变之前发生
        partial void OnLongitudeChanged(ModifyInfo modifyInfo);//经度Longitude改变之后发生
        partial void OnLatitudeChanging(ModifyInfo modifyInfo);//纬度Latitude改变之前发生
        partial void OnLatitudeChanged(ModifyInfo modifyInfo);//纬度Latitude改变之后发生
        partial void OnKeyWordsChanging(ModifyInfo modifyInfo);//关键字KeyWords改变之前发生
        partial void OnKeyWordsChanged(ModifyInfo modifyInfo);//关键字KeyWords改变之后发生

        #endregion
        public virtual string DetailURI { get; set; }
        public virtual string DetailHTMLURI { get; set; }
        public virtual string ManageEditURI { get; set; }
        public virtual string ManageDetailURI { get; set; }
        public override void OnLoaded()
        {
            base.OnLoaded();
            DetailURI = ZModel.InitDetailURI("LongLa", "LongLa_ID", LongLa_ID);
            DetailHTMLURI = ZModel.InitDetailHTMLURI("LongLa", "LongLa_ID", LongLa_ID);
            ManageEditURI = ZModel.InitMEditURI("LongLa", "LongLa_ID", LongLa_ID);
            ManageDetailURI = ZModel.InitMDetailURI("LongLa", "LongLa_ID", LongLa_ID);
            OnModelLoaded();
        }

        partial void OnModelCreated();
        partial void OnModelLoaded();
    }
}